package cn.hl.hm.controller.st;

import cn.hl.hm.logic.st.StDriverLogic;
import cn.hl.hm.logic.st.StOrderLogic;
import cn.hl.hm.util.InfoCode;
import cn.hl.hm.vo.StOrderVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * 司机同步到零担
 * Created by xianghan on 17/12/13.
 */
@Controller
@RequestMapping(value = "/st/")
public class StDriverController {
    private static final Logger logger = LoggerFactory.getLogger(StDriverController.class);
    @Autowired
    private StDriverLogic stDriverLogic;

    @RequestMapping(value = "/driver/sync", method = RequestMethod.GET)
    public String syncAllDriver(HttpServletRequest request, ModelMap modelMap) throws IOException {
        logger.info("司机车辆---同步---/st/driver/sync");
        try {
            stDriverLogic.ayncAllDriverVehicel();
            modelMap.addAttribute("infoCode", InfoCode.SUCCESS);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "result";
    }
}
